/**
 * Package	: com.coship.adstorm.dao.impl
 * File		: PositionInfoDaoImpl.java
 * Company 	: Shenzhen Coship Electronics CO., LTD.
 * Version  : v1.0
 * Description 	: <Detail Description for package>
 *
 * Copyright (c) 2003-2009 Shenzhen Coship Electronics CO., LTD.
 * Rainbow Bldg.,North,Hi-Tech Industrial Park,Nanshan District,Shenzhen,China,P.C.518057.
 * All rights reserved.
 * The contents of this file are confidential and proprietary to COSHIP.
 * Copying is explicitly prohibited without the express permission of COSHIP.
 *
 * Create Date	: Apr 27, 2010
 * Create By    : 904120
 * History :$
 */
package com.coship.vasms.adstorm.dao.impl;

import com.coship.vasms.adstorm.dao.PositionInfoDao;
import com.coship.vasms.adstorm.model.PositionInfo;

/**
 * 
 * File Name : PositionInfoDaoImpl.java
 * 
 * @Description : <Detail Description for Class >
 * @author 904120
 */
public class PositionInfoDaoImpl extends BaseDaoImpl implements PositionInfoDao {

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.coship.adstorm.dao.PositionInfoDao#updatePositionInfo(com.coship.adstorm.model.PositionInfo)
	 */
	@Override
	public int updatePositionInfo(PositionInfo positionInfo) {
		// TODO Auto-generated method stub
		return getSqlMapClientTemplate().update("updatePositionInfo",
				positionInfo);
	}

	@Override
	public int countPositionInfoByCondition(PositionInfo positionInfo) {
		// TODO Auto-generated method stub
		Object obj = getSqlMapClientTemplate().queryForObject(
				"countPositionByCondition", positionInfo);
		if (obj != null && obj instanceof Integer) {
			return (Integer) obj;
		}
		return -1;
	}

	@Override
	public int addPositionInfo(PositionInfo positionInfo) {
		// TODO Auto-generated method stub
		Object obj = getSqlMapClientTemplate().insert("insertPositionInfo",
				positionInfo);
		if (obj != null && obj instanceof Integer) {
			return (Integer) obj;
		}
		return -1;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.coship.adstorm.dao.PositionInfoDao#updatePositionInfo(com.coship.adstorm.model.PositionInfo)
	 */
	@Override
	public int updatePositionInfoState(PositionInfo positionInfo) {
		// TODO Auto-generated method stub
		Object obj = getSqlMapClientTemplate().update(
				"updatePositionInfoState", positionInfo);
		if (obj != null && obj instanceof Integer) {
			return (Integer) obj;
		}
		return -1;
	}

	

}
